﻿//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using OpenConnect.Utils;
//using OpenConnect.Clients.Utils;

//namespace SusuCMS.Connect.Clients.Tencent.QQ
//{
//    public class QQOpenConnectClient : IOpenConnectClient
//    {
//        private IHttpClient _httpClient;

//        public AppInfo AppInfo { get; private set; }

//        public QQOpenConnectClient(AppInfo appInfo)
//            : this(appInfo, HttpClient.Instance)
//        {
//        }

//        public QQOpenConnectClient(AppInfo appInfo, IHttpClient httpClient)
//        {
//            AppInfo = appInfo;
//            _httpClient = httpClient;
//        }

//        public string BuildLoginUrl(string display, ResponseType responseType)
//        {
//            return new LoginUrlBuilder("https://graph.qq.com/oauth2.0/authorize")
//            .Build(AppInfo, display, responseType);
//        }

//        public AccessTokenResponse GetAccessToken(string authCode, string state)
//        {
//            var now = DateTime.Now;

//            var request = new GetAccessTokenRequest("https://graph.qq.com/oauth2.0/token", _httpClient);
//            var response = request.GetResponse(AppInfo, authCode, state);

//            return TencentGetAccessTokenResponseParser.Parse(response, now);
//        }

//        public IUserInfo GetUserInfo(string accessToken, string userId)
//        {
//            return new QQGetUserInfoRequest(_httpClient)
//            .GetResponse(AppInfo, accessToken);
//        }
//    }
//}
